<?=$this->load->view('include_header',null)?>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('archive/idcard/'.$id)?>" class="report"><?=(empty($id))?"录入新":"编辑"?>客户基本信息</a></li>
				<?php if(!empty($info->id)):?><li><a id="printInfo" class="folder_table">打印本页信息</a></li><?php endif;?>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
<!-- table begin -->
<form method="post" id="form"  enctype="multipart/form-data" action="<?=site_url('schengen/ec_update/'.$cateid)?>">

	<h3>厄瓜多尔申请表</h3>
    <table width="100%">
    <thead>
        <tr>
          <td colspan="4" align="right"><img src="<?= (@$info->avatar)?@$info->avatar:'images/avatar.gif'?>" width="150" height="150" /></td>
		  <td align="right">
		  上传照片<br />
		  <input type="file" name="userphoto" /><br />
		  (.gif|.jpg|.png文件,最大1M)<br />
		  <?php if (@$info->attachment):?><a href="<?= @$info->attachment?>" target="_blank">点击下载附件</a><?php endif; ?>
		  &nbsp;&nbsp;&nbsp;&nbsp;上传附件<br />
		  <input type="file" name="userfile" /><br />
		  (.pdf|.zip|.rar|.doc,最大2M)		  
		  </td>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="5" align="right">			
			<input type="hidden" name="id" value="<?=$id?>" />
			<input id="button1" type="submit" value="提交信息" />
			<input id="button2" type="reset" value="重置" />
			</td>
        </tr>
    </tfoot>

    <tbody>
        <tr class="odd">
            <td>NOMBRES Y APELLIDOS/ FULL NAME</td>
            <td><input type="text" name="name" value="<?= @$info->name?>" /></td>
            <td>&nbsp;</td>
            <td>ACTIVIDAD QUE DESARROLLARA/ ACTIVITY DURING STAY</td>
            <td><input type="text" name="activity" value="<?= @$info->activity?>" /></td>
        </tr>
        <tr class="even">
            <td>NACIONALIDAD/ NATIONALITY</td>
            <td><input type="text" name="nationality" value="<?= @$info->nationality?>" /></td>
            <td>&nbsp;</td>
            <td>FECHA DE NACIMIENTO/ DATE OF BIRTH</td>
            <td>
			<select name="birth_d"><?php for($i=1;$i<=31;$i++) echo "<option value='$i'".((@$info->birth_d==$i)?"selected":"").">$i</option>"; ?></select> - 
			<select name="birth_m"><?php for($i=1;$i<=12;$i++) echo "<option value='$i'".((@$info->birth_m==$i)?"selected":"").">$i</option>"; ?></select> - 
			<select name="birth_y"><?php for($i=2011;$i>1940;$i--) echo "<option value='$i'".((@$info->birth_y==$i)?"selected":"").">$i</option>"; ?></select>
			</td>
        </tr>
        <tr class="odd">
            <td>LUGAR DE NACIMIENTO/ PLACE OF BIRTH</td>
            <td><input type="text" name="birth_place" value="<?= @$info->birth_place?>" /></td>
            <td>&nbsp;</td>
            <td>DIRECCIÓN DOMICILIARA/ RESIDENCE ADDRESS</td>
            <td><input type="text" name="residence_address" value="<?= @$info->residence_address?>" /></td>
        </tr>
        <tr class="even">
            <td>PASAPORTE  NUMERO/ PASSPORT NUMBER</td>
            <td><input type="text" name="travel_document_num" value="<?= @$info->travel_document_num?>" /></td>
            <td>&nbsp;</td>
            <td>ESTADO CIVIL/ MARITAL STATUS</td>
            <td><input type="text" name="marital_status" value="<?= @$info->marital_status?>" /></td>
        </tr>
        <tr class="odd">
            <td>PREOFESION/ PROFESION</td>
            <td><input type="text" name="profesion" value="<?= @$info->profesion?>" /></td>
			<td>&nbsp;</td>
			<td>PASAPORTE VALIDO HASTA/ PASSPORT EXPIRATION DATE</td>
            <td><input type="text" name="travel_document_valid_date" value="<?= @$info->travel_document_valid_date?>" id="travel_document_valid_date" /></td>
        </tr>
        <tr class="even">
          <td colspan="5">FAMILIARES QUE INGRESARAN AL ECUADOR/ FAMILY MEMBERS TO ENTER ECUADOR<br />
		  1.APELLIDOS Y NOMBRES/ FULL NAME<input type="text" name="member_name1" value="<?= @$info->member_name1?>" /> &nbsp; PARENTESCO/ RELATION<input type="text" name="member_relation1" value="<?= @$info->member_relation1?>" /> &nbsp; EDAD/ AGE<input type="text" name="member_age1" value="<?= @$info->member_age1?>" /><br />
		  2.APELLIDOS Y NOMBRES/ FULL NAME<input type="text" name="member_name2" value="<?= @$info->member_name2?>" /> &nbsp; PARENTESCO/ RELATION<input type="text" name="member_relation2" value="<?= @$info->member_relation2?>" /> &nbsp; EDAD/ AGE<input type="text" name="member_age2" value="<?= @$info->member_age2?>" /><br />
		  3.APELLIDOS Y NOMBRES/ FULL NAME<input type="text" name="member_name3" value="<?= @$info->member_name3?>" /> &nbsp; PARENTESCO/ RELATION<input type="text" name="member_relation3" value="<?= @$info->member_relation3?>" /> &nbsp; EDAD/ AGE<input type="text" name="member_age3" value="<?= @$info->member_age3?>" /><br />
		  4.APELLIDOS Y NOMBRES/ FULL NAME<input type="text" name="member_name4" value="<?= @$info->member_name4?>" /> &nbsp; PARENTESCO/ RELATION<input type="text" name="member_relation4" value="<?= @$info->member_relation4?>" /> &nbsp; EDAD/ AGE<input type="text" name="member_age4" value="<?= @$info->member_age4?>" /><br />
		  5.APELLIDOS Y NOMBRES/ FULL NAME<input type="text" name="member_name5" value="<?= @$info->member_name5?>" /> &nbsp; PARENTESCO/ RELATION<input type="text" name="member_relation5" value="<?= @$info->member_relation5?>" /> &nbsp; EDAD/ AGE<input type="text" name="member_age5" value="<?= @$info->member_age5?>" /></td>
        </tr>
        <tr class="odd">
            <td colspan="5"></td>
        </tr>
        
    </tbody>
	</table>
<!-- table end -->
</form>

			</div>
		</div>
		
		<?=$this->load->view('include_sidebar',array('id'=>$id,'forms'=>$forms))?>
	</div>

<script type="text/javascript">
$().ready(function() {
  $("#form").validate({
    rules: {
		name:"required",
		activity:"required",
		nationality:"required",
		travel_document_num:"required",
		marital_status:"required",
		travel_document_valid_date:"required"
    }
  });
  
	$.datepicker.setDefaults(
		{
		dateFormat: 'dd/mm/yy',
		changeMonth: true,
		changeYear: true,
		showOn: "both",
		buttonImage: "images/calendar.gif",
		buttonImageOnly: true
		}
	);
	
	$("#travel_document_valid_date").datepicker();

	$("#printInfo").click(function(o) {
		var prints = [
			{rel_id: <?=$cateid?>, rec_id: <?=$id?>}
		]  ;
		
		var jdata = JSON.stringify(prints);
		//alert(jdata);
		$.post("<?=site_url('proxy/does/'.str_replace('==','',base64_encode('http://'.$_SERVER['SERVER_NAME'].':9090/javaprduct/servlet/test')))?>",{clients:jdata},function(msg){alert(msg)});
	});
	
	$("#printInfo").ajaxError(function(event,request, settings){
		//$(this).append("<li>出错页面:" + settings.url + "</li>");
		alert("无法访问"+ settings.url );
	}); 
 
});
</script>

<?=$this->load->view('include_footer',null)?>